use regex::Regex;

#[derive(Debug)]
struct Blueprint {
    id: usize,
    total_minute: usize,
    ore_robot_costs_ore: usize,
    clay_robot_costs_ore: usize,
    obsidian_robot_costs_ore_clay: (usize, usize),
    geode_robot_costs_ore_obsidian: (usize, usize),
}

fn parse_input() -> Vec<Blueprint> {
    let re = Regex::new(r"[0-9]+").unwrap();
    include_str!("../input.txt")
        .lines()
        .map(|line| -> Blueprint {
            let mut numbers: Vec<usize> = Vec::new();
            for (res, []) in re.captures_iter(line).map(|c| c.extract()) {
                numbers.push(res.parse().unwrap());
            }
            Blueprint {
                id: numbers[0],
                total_minute: 24,
                ore_robot_costs_ore: numbers[1],
                clay_robot_costs_ore: numbers[2],
                obsidian_robot_costs_ore_clay: (numbers[3], numbers[4]),
                geode_robot_costs_ore_obsidian: (numbers[5], numbers[6])
            }
        })
        .collect()
}

fn part1() {
    #[derive(Debug, PartialEq, Eq, Hash)]
    struct State {
        minute: usize,
        ore_number: usize,
        ore_robot_number: usize,
        clay_number: usize,
        clay_robot_number: usize,
        obsidian_number: usize,
        obsidian_robot_number: usize,
        geode_number: usize,
        geode_robot_number: usize,
    }

    impl State {
        fn new(minute: usize, ore_number: usize, ore_robot_number: usize, clay_number: usize, clay_robot_number: usize, obsidian_number: usize, obsidian_robot_number: usize, geode_number: usize, geode_robot_number: usize) -> Self {
            Self { minute, ore_number, ore_robot_number, clay_number, clay_robot_number, obsidian_number, obsidian_robot_number, geode_number, geode_robot_number }
        }
        
        fn next_states(self, blueprint: &Blueprint) -> Vec<Self> {
            let next_states = Vec::new();

            if self.ore_number >= blueprint.geode_robot_costs_ore_obsidian.0 && self.obsidian_number >= blueprint.geode_robot_costs_ore_obsidian.1 {
                

                ore_number -= self.geode_robot_costs_ore_obsidian.0;
                obsidian_number -= self.geode_robot_costs_ore_obsidian.1;
                true
            } else {
                false
            };

            let is_new_obsidian_robot = if ore_number >= self.obsidian_robot_costs_ore_clay.0 && clay_number >= self.obsidian_robot_costs_ore_clay.1 {
                ore_number -= self.obsidian_robot_costs_ore_clay.0;
                clay_number -= self.obsidian_robot_costs_ore_clay.1;
                true
            } else {
                false
            };

            let is_new_clay_robot = if ore_number >= self.clay_robot_costs_ore {
                ore_number -= self.clay_robot_costs_ore;
                true
            } else {
                false
            };

            let is_new_ore_robot = if ore_number >= self.ore_robot_costs_ore {
                ore_number -= self.ore_robot_costs_ore;
                true
            } else {
                false
            };

            next_states
        } 
    }

}

fn main() {

}
